package com.ces.knacky.model;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.xml.bind.annotation.XmlTransient;

import org.apache.commons.lang.builder.EqualsBuilder;

import com.ces.knacky.framework.model.AbstractMasterEntity;

/** @author Hibernate CodeGenerator */
public class OrderTable extends AbstractMasterEntity implements Serializable {

    /** persistent field */
    private com.ces.knacky.model.OrderStatus orderStatus;

    /** persistent field */
    private Set userTransactions;

    /** persistent field */
    private Set orderItems;
    

    /** persistent field */
    private Set orderInventories;

    /** full constructor */
    public OrderTable(Date createTime, Date updateTime, com.ces.knacky.model.UserTable user, com.ces.knacky.model.OrderStatus orderStatus, com.ces.knacky.model.Flag flag, Set userTransactions, Set orderItems, Set orderInventories) {
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.user = user;
        this.orderStatus = orderStatus;
        this.flag = flag;
        this.userTransactions = userTransactions;
        this.orderItems = orderItems;
        this.orderInventories = orderInventories;
    }

    /** default constructor */
    public OrderTable() {
    }

    /** minimal constructor */
    public OrderTable(com.ces.knacky.model.UserTable user, com.ces.knacky.model.OrderStatus orderStatus, com.ces.knacky.model.Flag flag, Set userTransactions, Set orderItems, Set orderInventories) {
        this.user = user;
        this.orderStatus = orderStatus;
        this.flag = flag;
        this.userTransactions = userTransactions;
        this.orderItems = orderItems;
        this.orderInventories = orderInventories;
    }

    public Date getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public com.ces.knacky.model.OrderStatus getOrderStatus() {
        return this.orderStatus;
    }

    public void setOrderStatus(com.ces.knacky.model.OrderStatus orderStatus) {
        this.orderStatus = orderStatus;
    }

    public com.ces.knacky.model.Flag getFlag() {
        return this.flag;
    }

    public void setFlag(com.ces.knacky.model.Flag flag) {
        this.flag = flag;
    }

    public com.ces.knacky.model.UserTable getUser() {
        return this.user;
    }

    public void setUser(com.ces.knacky.model.UserTable user) {
        this.user = user;
    }

    @XmlTransient
    public Set getUserTransactions() {
        return this.userTransactions;
    }

    public void setUserTransactions(Set userTransactions) {
        this.userTransactions = userTransactions;
    }

    @XmlTransient
    public Set getOrderItems() {
        return this.orderItems;
    }

    public void setOrderItems(Set orderItems) {
        this.orderItems = orderItems;
    }

    @XmlTransient
    public Set getOrderInventories() {
        return this.orderInventories;
    }

    public void setOrderInventories(Set orderInventories) {
        this.orderInventories = orderInventories;
    }

    public boolean equals(Object other) {
        if ( !(other instanceof OrderTable) ) return false;
        OrderTable castOther = (OrderTable) other;
        return new EqualsBuilder()
            .append(this.getId(), castOther.getId())
            .isEquals();
    }

}
